import request from '@/utils/request'

// 查询用户刷题记录列表
export function listUserPracticeRecord(query) {
  return request({
    url: '/exam/userPracticeRecord/list',
    method: 'get',
    params: query
  })
}

// 查询用户刷题记录所有列表
export function listAllUserPracticeRecord(query) {
  return request({
    url: '/exam/userPracticeRecord/listAll',
    method: 'get',
    params: query
  })
}

// 查询用户刷题记录详细
export function getUserPracticeRecord(recordId) {
  return request({
    url: '/exam/userPracticeRecord/getInfo/' + recordId,
    method: 'get'
  })
}

// 新增用户刷题记录
export function addUserPracticeRecord(data) {
  return request({
    url: '/exam/userPracticeRecord/add',
    method: 'post',
    data: data
  })
}

// 修改用户刷题记录
export function updateUserPracticeRecord(data) {
  return request({
    url: '/exam/userPracticeRecord/edit',
    method: 'post',
    data: data
  })
}

// 删除用户刷题记录
export function delUserPracticeRecord(recordId) {
  return request({
    url: '/exam/userPracticeRecord/remove/' + recordId,
    method: 'get'
  })
}

// 获取用户题库的题目答题情况和进度信息
export function getBankQuestionPracticeInfo(bankId) {
  return request({
    url: '/exam/userPracticeRecord/bankQuestionPracticeInfo/' + bankId,
    method: 'get'
  })
}

// 获取用户题库的错题信息
export function getBankWrongQuestionInfo(bankId) {
  return request({
    url: '/exam/userPracticeRecord/bankWrongQuestionInfo/' + bankId,
    method: 'get'
  })
}

// 获取当前用户所有题库的刷题进度
export function myBankProgressInfo() {
  return request({
    url: '/exam/userPracticeRecord/myBankProgressInfo',
    method: 'get'
  })
}

// 重置指定题库的刷题进度与记录
export function resetBankProgress(bankId) {
  return request({
    url: '/exam/userPracticeRecord/resetBankProgress/' + bankId,
    method: 'post'
  })
}